using System.ComponentModel.DataAnnotations;

namespace StudentManagement.Application.DTOs;

public class StudentDTO
{
    public int Id { get; set; }
    
    [Required(ErrorMessage = "学号不能为空")]
    [StringLength(20, ErrorMessage = "学号长度不能超过20个字符")]
    public string StudentId { get; set; }
    
    [Required(ErrorMessage = "姓名不能为空")]
    [StringLength(50, ErrorMessage = "姓名长度不能超过50个字符")]
    public string Name { get; set; }
    
    [Required(ErrorMessage = "性别不能为空")]
    [StringLength(10, ErrorMessage = "性别长度不能超过10个字符")]
    public string Gender { get; set; }
    
    [Required(ErrorMessage = "出生日期不能为空")]
    public DateTime DateOfBirth { get; set; }
    
    [StringLength(200, ErrorMessage = "地址长度不能超过200个字符")]
    public string Address { get; set; }
    
    [StringLength(20, ErrorMessage = "电话号码长度不能超过20个字符")]
    public string PhoneNumber { get; set; }
    
    [Required(ErrorMessage = "电子邮箱不能为空")]
    [EmailAddress(ErrorMessage = "请输入有效的电子邮箱地址")]
    public string Email { get; set; }
    
    public DateTime EnrollmentDate { get; set; }
    
    [StringLength(20, ErrorMessage = "状态长度不能超过20个字符")]
    public string Status { get; set; }
    
    [Required(ErrorMessage = "班级ID不能为空")]
    public int ClassId { get; set; }
    
    // 用于显示的班级名称
    public string ClassName { get; set; }
}